#include "pso.h"
#include "rand.h"
#include "metapso.h"
#include "params.h"
#include <iostream>
#include <cstdlib>
#include <unistd.h>

void pso();
void alphas();
void omegas();
void meta();

int main(int argc, char *argv[])
{
    int option;

    // Consistent random seed between succesive runs.
    //std::srand(667);
    std::srand(time(NULL));

    // Get the command line option.
    option = getopt(argc, argv, "naom");
    switch(option) {
      case 'n':
        pso();
        break;
      case 'a':
        alphas();
        break;
      case 'o':
        omegas();
        break;
      case 'm':
        meta();
        break;
    }

    return 0;
}

void pso()
{
    // Default parameters for the PSO.
    Params params;
    Pso pso(&params);
    pso.exec();
}

void alphas()
{
    MetaPso metapso;
    metapso.testAlphas();
}

void omegas()
{
    MetaPso metapso;
    metapso.testOmega();
}

void meta()
{
    MetaPso metapso;
    metapso.metaPso();
}
